<template>
	<view class="rows" :style="{backgroundColor: pageData.bgColor, padding:`0 ${pageData.margin*2}rpx`}" v-if="pageData">
		<!-- 真机点击跳转视频号 -->
		<channel-video :finder-user-name="pageData.finderUserName" :feed-id="pageData.feedId" :feed-token="pageData.feedToken" :autoplay="pageData.autoplay"
			object-fit="cover" class="width" :style="{height, 'vertical-align': 'middle'}" v-if="pageData.type == 3"></channel-video>

		<video :src="pageData.videoSrc" :autoplay="pageData.autoplay" object-fit="cover" class="Video" :style="{height}" v-else></video>
	</view>
</template>

<script>
	export default {
		name:'VideoList',
		props:['pageData'],
		data() {
			return {
				videoSrc:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4'
			}
		},
		computed: {
			height(){
				let scale = this.pageData.scale || 0.5625 // 默认16:9
				let margin = this.pageData.margin || 0
				return scale * (750 - margin * 2 * 2) + 'rpx'
			}
		}
	}
</script>
<style lang="scss" scoped>
.Video{
	width: 100%;
	display: block;
	padding: 0 !important;
	margin: 0 !important;
}
</style>
